<style lang='less'>
  .yangxing {
    background-color: red;
    color: red;
  }
  .demo-drawer-footer{
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    border-top: 1px solid #e8e8e8;
    padding: 10px 16px;
    text-align: right;
    background: #fff;
  }
  .page_style {
    margin: 20px 5px;
  }
  .input-frame {
    width: 120px;
    margin-right: 10px;
  }
  .house-list > .group {
    background: white;
    padding: 10px;
    margin-top: 10px;
  }
  .house-list > .group > .item {
    border-bottom: 1px solid #f5f5f5;
    padding: 10px 0;
  }
  .house-list > .group > .item .top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
  }

  .house-list > .group > .item .title {
    font-size: 14px;
    color: #333333;
  }
  .house-list > .group > .item .address {
    font-size: 12px;
    color: gray;
    display: flex;
    align-items: center;
  }
  .house-list > .group > .item .detail {
    font-size: 12px;
    color: dodgerblue;
  }
  .opt-area-02 {
    display: flex;
    align-items: center;
    flex-direction: column;
    border: 1px solid #abdcff;
    background-color: #f0faff;
    padding: 8px 16px 8px 16px;
    border-radius: 4px;
    margin-bottom: 10px;
  }
  .opt-area-02 .right-con {
    width: 100%;
    margin-top: 5px;
    display: flex;
  }
  .opt-area-02 .left-con {
    font-size: 14px;
    width: 100%;
  }
  .opt-area-02 .left-con span {
    font-weight: bold;
  }
  .opt-area-02 .right-con input {
    width: 164px;
    margin-right: 10px;
  }
  .opt-area-02 .right-con .input-frame {
    width: 200px;
    margin-right: 10px;
  }
  .table-action-btn {
    margin-right: 3px;
  }
  // .container >>> .ivu-btn-small {
  //     height: 24px;
  //     padding: 0 5px;
  //     font-size: 12px;
  //     border-radius: 3px;
  // }
  .btn-action {
    margin-bottom: 10px;
  }
  .page_style .input-vaccines .ivu-select-single .ivu-select-selection {
    height: 50px;
    position: relative;
  }
  .page_style .ivu-select-selection .ivu-select-selected-value {
    display: block;
    height: 30px;
    line-height: 30px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 8px;
    padding-right: 24px;
  }
</style>
<template>
  <div class="container">
    <div class="opt-area-02">
      <div class="right-con">
        <div class="input-frame" style="width: 164px">
            <Input type="text" @on-click="init(1)" placeholder="请输入姓名" style="width: 164px" v-model="params.xm"
                    icon="ios-search"/>
        </div>
        <div class="input-frame" style="width: 164px">
            <Input type="text" @on-click="init(1)" placeholder="请输入身份证号" style="width: 164px" v-model="params.sfzh"
                    icon="ios-search"/>
        </div>
        <div class="input-frame" style="width: 164px">
            <Input type="text" @on-click="init(1)" placeholder="请输入联系方式" style="width: 164px" v-model="params.sjh"
                  icon="ios-search"/>
        </div>
        <Button class="table-action-btn" type="info" @click="init()">刷新</Button>
      </div>
    </div>
    <Table :loading="loading1" :columns="columns1" ref="selection"  :data="data1"  size="small" border>
      <template slot-scope="{ row }" slot="caozuo">
        <Row style="margin-bottom: 5px; margin-top: 2px">
          <Button class="table-action-btn" type="success" size="small" :disabled="issubmit" @click="showdetail(row)">编辑</Button>
          <Button class="table-action-btn" type="error" size="small" :disabled="issubmit" @click="showgeli(row)">隔离处置</Button>
          <Button class="table-action-btn" type="warning" size="small" :disabled="issubmit" @click="showlishen(row)">离沈处置</Button>
        </Row>
        <Row style="margin-bottom: 5px; margin-top: 2px">
          <Button class="table-action-btn" type="info" size="small" :disabled="issubmit" @click="showhengchuan(row)">横传</Button>
          <Button class="table-action-btn" type="primary" size="small" :disabled="issubmit" @click="showShilianList(row)">失联处置</Button>
          <!-- <Button class="table-action-btn" type="warning" size="small" :disabled="issubmit" @click="saveshilian(row)">失联处置</Button> -->
        </Row>
      </template>
    </Table>
    <Page class="page_style" :total="totalnum" :current="currentPageNo"
          :page-size="currentPageSize" @on-change="changePageNo" show-total  show-sizer @on-page-size-change="sizeL" style="height: 30px;line-height: 30px;font-size: 12px;" />
    <Drawer
            title="编辑"
            v-model="editinfo.show"
            width="1000"
            :mask-closable="true"
            :styles="styles"
        >
            <Form :model="formData">
              <div class="title-style">业务变更信息</div>
                <Row :gutter="32">
                    <Col span="8">
                        <FormItem label="姓名（新）" label-position="top">
                            <Input v-model="formData.xm_new" placeholder="" />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="身份证号（新）" label-position="top">
                            <Input v-model="formData.sfzh_new" placeholder="" />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="手机号（新）" label-position="top">
                            <Input v-model="formData.sjh_new" placeholder="" />
                        </FormItem>
                    </Col>
                </Row>
                <!-- <Row :gutter="32">
                </Row> -->
                <!-- <Row :gutter="32">
                  <Col span="12">
                        <FormItem label="现居住地（省）（新）" label-position="top">
                            <Input v-model="formData.xjzdsheng_new" placeholder="" />
                        </FormItem>
                    </Col>
                    <Col span="12">
                        <FormItem label="现居住地（市）（新）" label-position="top">
                            <Input v-model="formData.xjzdshi_new" placeholder="" />
                        </FormItem>
                    </Col>
                </Row> -->
                <Row :gutter="32">
                  <Col span="8">
                        <FormItem label="现居住地（区）（新）" label-position="top">
                            <!-- <Input v-model="formData.xjzd_new" placeholder="" /> -->
                            <Select v-model="formData.area1" placeholder="区/县" filterable @on-change="perChange(1)">
                              <Option v-for="obj in addressInfo.list1" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="街道（新）" label-position="top">
                            <!-- <Input v-model="formData.jd_new" placeholder="" /> -->
                            <Select v-model="formData.area2" placeholder="街道（新）" filterable @on-change="perChange(2)">
                              <Option v-for="obj in addressInfo.list2" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="社区（新）" label-position="top">
                            <!-- <Input v-model="formData.sq_new" placeholder="" /> -->
                            <Select v-model="formData.area3" placeholder="社区（新）" filterable>
                              <Option v-for="obj in addressInfo.list3" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                </Row>
                <!-- <Row :gutter="32">
                </Row> -->
                <Row :gutter="32">
                  <Col span="32">
                        <FormItem label="现住地详细地址(新)" label-position="top">
                            <Input type="textarea"  v-model="formData.xzdxz_new" placeholder="" />
                        </FormItem>
                    </Col>
                </Row>
                <Row :gutter="32">
                  <Col span="8">
                        <FormItem label="是否核酸检测" label-position="top">
                            <Select v-model="formData.nuclease" placeholder="是否核酸检测">
                              <Option value="2">是</Option>
                              <Option value="1">否</Option>
                            </Select>
                        </FormItem>
                    </Col>
                  <Col span="8" v-if="formData.nuclease === '2'">
                        <FormItem label="核酸检测结果" label-position="top">
                             <Select v-model="formData.detection" placeholder="核酸检测结果">
                              <Option value="0">阴性</Option>
                              <Option value="1">阳性</Option>
                              <Option value="2">等待结果</Option>
                            </Select>
                        </FormItem>
                    </Col>
                </Row>
                <div class="title-style">公安来源信息</div>
                <Row :gutter="32">
                    <Col span="8">
                        <FormItem label="姓名" label-position="top">
                            <Input v-model="formData.xm" placeholder="" disabled/>
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="身份证号" label-position="top">
                            <Input v-model="formData.sfzh" placeholder="" disabled />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="电话" label-position="top">
                            <Input v-model="formData.sjh" placeholder="" disabled />
                        </FormItem>
                    </Col>
                </Row>
                <Row :gutter="32">
                    <Col span="8">
                        <FormItem label="现居住地（省）" label-position="top">
                            <Input v-model="formData.xjzdsheng" placeholder="" disabled />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="现居住地（市）" label-position="top">
                            <Input v-model="formData.xjzdshi" placeholder="" disabled />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="现居住地（区）" label-position="top">
                            <Input v-model="formData.xjzd" placeholder="" disabled />
                        </FormItem>
                    </Col>
                    <!-- <Col span="12">
                        <FormItem label="街道" label-position="top">
                            <Input v-model="formData.jd" placeholder="" disabled />
                        </FormItem>
                    </Col> -->
                </Row>
                <!-- <Row :gutter="32">
                    <Col span="12">
                        <FormItem label="社区" label-position="top">
                            <Input v-model="formData.sq" placeholder="" disabled />
                        </FormItem>
                    </Col>
                </Row> -->
                <Row :gutter="32">
                  <Col span="8">
                        <FormItem label="是否在沈" label-position="top">
                            <Input v-model="formData.sfzs" placeholder="" disabled />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="数据来源" label-position="top">
                            <Input v-model="formData.sjly" placeholder="" disabled />
                        </FormItem>
                    </Col>
                    <Col span="8">
                        <FormItem label="来源时间" label-position="top">
                            <Input v-model="formData.rksj" placeholder="" disabled />
                        </FormItem>
                    </Col>
                </Row>
                <Row :gutter="32">
                    <Col span="32">
                        <FormItem label="核查参考" label-position="top">
                            <Input type="textarea" v-model="formData.hcck" placeholder="" disabled />
                        </FormItem>
                    </Col>
                </Row>
                <Row :gutter="32">
                    <Col span="32">
                        <FormItem label="现住地详细地址" label-position="top">
                            <Input type="textarea" v-model="formData.xzdxz" placeholder="" disabled />
                        </FormItem>
                    </Col>
                </Row>
                <Row :gutter="32">
                    <Col span="32">
                        <FormItem label="备注" label-position="top">
                            <Input type="textarea" v-model="formData.remark" placeholder="" disabled />
                        </FormItem>
                    </Col>
                </Row>
            </Form>
            <div class="demo-drawer-footer">
                <Button style="margin-right: 8px" @click="editinfo.show = false">关闭</Button>
                <Button type="primary" @click="save()" :disabled="issubmit">保存</Button>
            </div>
        </Drawer>
        <Drawer
            title="横传"
            v-model="hengchuaninfo.show"
            width="700"
            :mask-closable="true"
            :styles="styles"
        >
            <Form :model="hengchuanData">
                <Row :gutter="32">
                  <Col span="32">
                        <FormItem label="区/县" label-position="top">
                            <!-- <Input v-model="formData.xjzd_new" placeholder="" /> -->
                            <Select id="hengchuanselect1" v-model="hengchuanData.area1" placeholder="区/县" filterable @on-change="perChange1(1)">
                              <Option v-for="obj in addressInfo.list1" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="32">
                        <FormItem label="街道" label-position="top">
                            <!-- <Input v-model="formData.jd_new" placeholder="" /> -->
                            <Select id="hengchuanselect2" v-model="hengchuanData.area2" placeholder="街道" filterable @on-change="perChange1(2)">
                              <Option v-for="obj in addressInfo.list2" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                    <Col span="32">
                        <FormItem label="社区" label-position="top">
                            <!-- <Input v-model="formData.sq_new" placeholder="" /> -->
                            <Select id="hengchuanselect3" v-model="hengchuanData.area3" placeholder="社区" filterable>
                              <Option v-for="obj in addressInfo.list3" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                            </Select>
                        </FormItem>
                    </Col>
                </Row>
            </Form>
            <div class="demo-drawer-footer">
                <Button style="margin-right: 8px" @click="hengchuaninfo.show = false">关闭</Button>
                <Button type="primary" @click="savehengchuan()">横传</Button>
            </div>
        </Drawer>
        <Drawer
            title="离沈处置"
            v-model="lisheninfo.show"
            width="700"
            :mask-closable="true"
            :styles="styles"
        >
            <Form :model="lishenData">
                <Row :gutter="32" id="lishenselect">
                  <Col span="32">
                    <FormItem label="离沈目的地省" label-position="top">
                            <Select v-model="lishenData.provinceid" placeholder="离沈目的地省" filterable @on-change="shengChange()">
                              <Option v-for="obj in shenglist" :value="obj.provinceid" :key="obj.provinceid">{{obj.province}}</Option>
                            </Select>
                        </FormItem>
                  </Col>
                  <Col span="32">
                    <FormItem label="离沈目的地市" label-position="top">
                            <Select v-model="lishenData.city" placeholder="离沈目的地市" filterable>
                              <Option v-for="obj in shilist" :value="obj.city" :key="obj.cityid">{{obj.city}}</Option>
                            </Select>
                        </FormItem>
                  </Col>
                  <Col span="32">
                    <FormItem label="离沈后详细地址" label-position="top">
                        <Input v-model="lishenData.leave_sy_destination" placeholder=""/>
                    </FormItem>
                  </Col>
                </Row>
            </Form>
            <div class="demo-drawer-footer">
                <Button style="margin-right: 8px" @click="lisheninfo.show = false">关闭</Button>
                <Button type="primary" @click="savelishen()">提交</Button>
            </div>
        </Drawer>
        <Drawer
            title="隔离处置"
            v-model="geliinfo.show"
            width="700"
            :mask-closable="true"
            :styles="styles"
        >
            <Form :model="geliData">
                <Row :gutter="32">
                  <Col span="32">
                    <FormItem label="类型" label-position="top">
                            <Select v-model="geliData.type" placeholder="类型" filterable>
                              <Option value="1" key="1">居家隔离</Option>
                              <Option value="2" key="2">集中隔离</Option>
                              <Option value="3" key="3">无需隔离</Option>
                              <Option value="4" key="4">社区管控</Option>
                              <Option value="8" key="8">健康监测</Option>
                            </Select>
                        </FormItem>
                  </Col>
                </Row>
            </Form>
            <div class="demo-drawer-footer">
                <Button style="margin-right: 8px" @click="geliinfo.show = false">关闭</Button>
                <Button type="primary" @click="savegeli()">提交</Button>
            </div>
        </Drawer>
        <Drawer
            title="失联信息"
            v-model="shilianlistinfo.show"
            width="750"
            :styles="styles"
        >
            <Row :gutter="32" style="margin-left:10px;margin-bottom:10px">
              <Button class="table-action-btn" type="info" @click="showcreateshilian()">新增</Button>
            </Row>
            <Table :loading="loading2" :columns="columns2" ref="selection"  :data="data2"  size="small" border>
            </Table>
            <div class="demo-drawer-footer">
                <Button style="margin-right: 8px" @click="shilianlistinfo.show = false">关闭</Button>
            </div>
        </Drawer>
        <Drawer
            title="添加失联信息"
            width="550"
            :mask-closable="true"
            :styles="styles"
            :closable="false"
            v-model="addshilianinfo.show">
            <Form :model="addshilianData">
                <Row :gutter="32">
                    <Col span="32">
                        <FormItem label="联系人" label-position="top">
                            <Input v-model="addshilianData.contact_people"/>
                        </FormItem>
                    </Col>
                </Row>
                <Row :gutter="32">
                    <Col span="32">
                        <FormItem label="联系时间" label-position="top">
                            <!-- <Input v-model="addshilianData.contact_date"/> -->
                            <DatePicker type="datetime" style="display: block" placeholder="选择时间" v-model="addshilianData.contact_date"></DatePicker>
                        </FormItem>
                    </Col>
                </Row>
                <!-- <Row :gutter="32">
                    <Col span="32">
                        <FormItem label="联系人类型" label-position="top">
                            <Select v-model="addshilianData.contact_type" placeholder="联系人类型" filterable>
                              <Option value="1" key="1">社区</Option>
                              <Option value="2" key="2">街道</Option>
                              <Option value="3" key="3">区县</Option>
                              <Option value="4" key="4">区公安</Option>
                              <Option value="5" key="5">市公安</Option>
                            </Select>
                        </FormItem>
                    </Col>
                </Row> -->
                <Row :gutter="32">
                    <Col span="32">
                        <FormItem label="备注" label-position="top">
                            <Input type="textarea" maxlength="200" show-word-limit v-model="addshilianData.remark"/>
                        </FormItem>
                    </Col>
                </Row>
            </Form>
            <div class="demo-drawer-footer">
                <Button style="margin-right: 8px" @click="addshilianinfo.show = false">关闭</Button>
                <Button type="primary" @click="saveshilianinfo()" :disabled="issubmit">保存</Button>
            </div>
        </Drawer>
  </div>
</template>

<script>
import { reportfindList, updateDataInfo, updateHengchuan, updateLishen, updateGeli, updateShilian,
  findProvincesList, findCitiesList, findShilianList } from '@/api/yi-qing-fang-kong'
import { getCityList } from '@/api/common'
import { grid_downlist, date0str, getUserByMZList } from '@/api/eventlist'
export default {
  data () {
    return {
      loginuserName: '',
      issubmit: false,
      editinfo: {
        show: false
      },
      hengchuaninfo: {
        show: false
      },
      lisheninfo: {
        show: false
      },
      geliinfo: {
        show: false
      },
      shilianlistinfo: {
        show: false
      },
      geliData: {
        type: ''
      },
      addshilianinfo: {
        show: false
      },
      loading1: false,
      loading2: false,
      hengchuanData: {
        area1: '',
        area2: '',
        area3: ''
      },
      addshilianData: {

      },
      lishenData: {
        leave_sy_destination: ''
      },
      rowDate: {},
      formData: {
        xm: '',
        sfzh: '',
        sjh: '',
        xjzdsheng: '',
        xjzdshi: '',
        xjzd: '',
        jd: '',
        sq: '',
        xzdxz: '',
        sfzs: '',
        status: '',
        leave_sy: '',
        xjzdsheng_new: '',
        xjzdshi_new: '',
        xjzd_new: '',
        jd_new: '',
        sq_new: '',
        xm_new: '',
        sfzh_new: '',
        sjh_new: '',
        xzdxz_new: '',
        area1: '',
        area2: '',
        area3: '',
        nuclease: '',
        detection: ''
      },
      addressInfo: { list1: [], list2: [], list3: [] },
      shenglist: [],
      shilist: [],
      company_list: [],
      styles: {
        height: 'calc(100% - 55px)',
        overflow: 'auto',
        paddingBottom: '53px',
        position: 'static'
      },
      params: { pageNo: 1, pageSize: 10, xm: '', sfzh: '', sjh: '' },
      currentPageNo: 1,
      currentPageSize: 10,
      totalnum: 0,
      data1: [],
      data2: [],
      columns1: [
        { type: 'index', fixed: 'left', width: '80', title: '序号', align: 'center' },
        { title: '姓名', fixed: 'left', width: '100', key: 'xm', align: 'center' },
        { title: '身份证号', width: '200', key: 'sfzh', align: 'center' },
        { title: '电话', width: '150', key: 'sjh', align: 'center' },
        { title: '现居住地（省）', width: '140', key: 'xjzdsheng', align: 'center' },
        { title: '现居住地（市）', width: '140', key: 'xjzdshi', align: 'center' },
        { title: '现居住地（区）', width: '140', key: 'xjzd_new', align: 'center' },
        { title: '街道', width: '100', key: 'jd_new', align: 'center' },
        { title: '社区', width: '200', key: 'sq_new', align: 'center' },
        { title: '现住地详细地址', width: '250', key: 'xzdxz', align: 'center' },
        { title: '创建时间', width: '150', key: 'task_create_time', align: 'center' },
        { title: '操作', fixed: 'right', width: '220', slot: 'caozuo', align: 'center' }
      ],
      columns2: [
        { type: 'index', width: '80', title: '序号', align: 'center' },
        { title: '姓名', width: '100', key: 'xm', align: 'center' },
        { title: '身份证号', width: '100', key: 'sfzh', align: 'center' },
        { title: '电话', width: '100', key: 'sjh', align: 'center' },
        { title: '联系人', width: '100', key: 'contact_people', align: 'center' },
        { title: '联系时间', width: '150', key: 'contact_date', align: 'center' },
        { title: '联系人类型', width: '100', key: 'contact_type', align: 'center' },
        { title: '创建时间', width: '150', key: 'create_time', align: 'center' },
        { title: '单位名称', width: '180', key: 'company_name', align: 'center' },
        { title: '备注', width: '200', key: 'remark', align: 'center' }
      ]
    }
  },
  methods: {
    init (currentPageNo) {
      if (currentPageNo) {
        this.currentPageNo = currentPageNo
      }
      let param = {
        pageSize: this.currentPageSize,
        pageNo: this.currentPageNo,
        xm: this.params.xm,
        sfzh: this.params.sfzh,
        sjh: this.params.sjh
      }
      this.addressInfo = { list1: [], list2: [], list3: [] }
      this.loading1 = true
      reportfindList(param).then(res => {
        if (res.data.errcode === 0) {
          this.data1 = res.data.data.results
          this.totalnum = res.data.data.totalRecord
        } else {
          this.$Notice.error({
            title: '获取列表失败',
            desc: res.data.errmsg
          })
        }
        // setTimeout(() => {
        //   console.log(socket, '等待socket链接成功')
        //   this.loading1 = false
        // }, 1500)
        this.loading1 = false
      })
    },
    save () {
      this.formData.xjzd_new = this.formData.area1
      this.formData.jd_new = this.formData.area2
      this.formData.sq_new = this.formData.area3
      if (this.formData.nuclease && this.formData.nuclease === '1') {
        this.formData.detection = ''
      }
      let params = this.formData
      this.$Modal.confirm({
        title: '是否确认进行保存操作？',
        onOk: () => {
          this.issubmit = true
          updateDataInfo(params).then(res => {
            if (res.data.errcode === 0) {
              this.$Notice.success({ title: '成功', desc: res.data.errmsg })
              this.editinfo.show = false
              this.init()
              this.issubmit = false
            } else {
              this.$Notice.error({ title: '失败', desc: res.data.errmsg })
              this.issubmit = false
            }
          })
          // this.issubmit = false
        }
      })
    },
    changePageNo (pageNo) {
      console.log(pageNo, '页数')
      this.currentPageNo = pageNo
      this.params.pageNo = pageNo
      this.init()
    },
    showdetail (row) {
      this.issubmit = false
      this.formData = row
      this.formData.area1 = row.xjzd_new
      this.formData.area2 = row.jd_new
      this.formData.area3 = row.sq_new
      this.getDownAddress(0, 1)
      this.editinfo.show = true
      console.log(this.formData, '====编辑信息====')
    },
    showhengchuan (row) {
      this.getDownAddress(0, 1)
      this.hengchuanData = {
        area1: '',
        area2: '',
        area3: ''
      }
      this.hengchuaninfo.show = true
      this.rowDate = row
    },
    showShilianList (row) {
      this.addshilianData = {}
      this.shilianlistinfo.show = true
      this.issubmit = false
      this.rowDate = row
      this.findShilianList()
    },
    showcreateshilian () {
      this.addshilianData = {}
      this.addshilianData.contact_people = this.loginuserName
      this.addshilianinfo.show = true
    },
    showlishen (row) {
      this.findProvincesList()
      this.lisheninfo.show = true
      this.rowDate = row
    },
    showgeli (row) {
      this.geliinfo.show = true
      this.rowDate = row
    },
    saveshilian (row) {
      let params = {
        sytid: row.sytid,
        id: row.id,
        seqid: row.seqid
      }
      this.$Modal.confirm({
        title: '是否确认进行失联处置操作？',
        onOk: () => {
          updateShilian(params).then(res => {
            if (res.data.errcode === 0) {
              this.$Notice.success({ title: '成功', desc: res.data.errmsg })
              this.init()
              this.issubmit = false
            } else {
              this.$Notice.error({ title: '失败', desc: res.data.errmsg })
              this.issubmit = false
            }
          })
        }
      })
    },
    saveshilianinfo () {
      if (!this.addshilianData.contact_people) {
        this.$Notice.error({ title: '错误', desc: '请输入联系人' })
        return
      }
      if (!this.addshilianData.contact_date) {
        this.$Notice.error({ title: '错误', desc: '请输入联系时间' })
        return
      }
      // if (!this.addshilianData.contact_type) {
      //   this.$Notice.error({ title: '错误', desc: '请驶入联系人类型' })
      //   return
      // }
      let row = this.rowDate
      let params = {
        lid: row.sytid,
        eid: row.seqid,
        contact_people: this.addshilianData.contact_people,
        contact_date: date0str(this.addshilianData.contact_date),
        contact_type: '1', // 默认是1
        remark: this.addshilianData.remark,
        sytid: row.sytid,
        id: row.id,
        seqid: row.seqid
      }
      this.$Modal.confirm({
        title: '是否确认进行添加失联信息操作？',
        onOk: () => {
          this.issubmit = true
          updateShilian(params).then(res => {
            if (res.data.errcode === 0) {
              this.$Notice.success({ title: '成功', desc: res.data.errmsg })
              this.addshilianinfo.show = false
              this.shilianlistinfo.show = false
              this.findShilianList()
              this.init()
              this.issubmit = false
            } else {
              this.$Notice.error({ title: '失败', desc: res.data.errmsg })
              this.issubmit = false
            }
          })
        }
      })
    },
    savegeli () {
      let row = this.rowDate
      let params = {
        sytid: row.sytid,
        id: row.id,
        end_result: this.geliData.type,
        seqid: row.seqid
      }
      this.$Modal.confirm({
        title: '是否确认进行隔离处置操作？',
        onOk: () => {
          updateGeli(params).then(res => {
            if (res.data.errcode === 0) {
              this.$Notice.success({ title: '成功', desc: res.data.errmsg })
              this.rowDate = {}
              this.geliinfo.show = false
              this.init()
              this.issubmit = false
            } else {
              this.$Notice.error({ title: '失败', desc: res.data.errmsg })
              this.issubmit = false
            }
          })
        }
      })
    },
    savehengchuan () {
      console.log(!this.hengchuanData.area1)
      if (!this.hengchuanData.area1) {
        this.$Notice.error({ title: '错误', desc: '请选择区/县' })
        return
      }
      if (!this.hengchuanData.area2) {
        this.$Notice.error({ title: '错误', desc: '请选择街道' })
        return
      }
      if (!this.hengchuanData.area3) {
        this.$Notice.error({ title: '错误', desc: '请选择社区' })
        return
      }
      let templist = this.addressInfo.list3
      let tempdata = {}
      for (let i = 0; i < templist.length; i++) {
        if (this.hengchuanData.area3 === templist[i].title) {
          tempdata = templist[i]
        }
      }
      let params = {
        area: this.hengchuanData.area1,
        street: this.hengchuanData.area2,
        community: this.hengchuanData.area3,
        to_node: '3',
        to_node_code: tempdata.company_code,
        sytid: this.rowDate.sytid,
        id: this.rowDate.id,
        seqid: this.rowDate.seqid
      }
      this.$Modal.confirm({
        title: '是否确认进行横传操作？',
        onOk: () => {
          updateHengchuan(params).then(res => {
            if (res.data.errcode === 0) {
              this.$Notice.success({ title: '成功', desc: res.data.errmsg })
              this.hengchuaninfo.show = false
              this.rowDate = {}
              this.init()
              this.issubmit = false
            } else {
              this.$Notice.error({ title: '失败', desc: res.data.errmsg })
              this.issubmit = false
            }
          })
        }
      })
    },
    savelishen () {
      if (!this.lishenData.provinceid) {
        this.$Notice.error({ title: '错误', desc: '请填写离沈后目的地省' })
        return
      }
      if (!this.lishenData.city) {
        this.$Notice.error({ title: '错误', desc: '请填写离沈后目的地市' })
        return
      }
      if (!this.lishenData.leave_sy_destination) {
        this.$Notice.error({ title: '错误', desc: '请填写离沈后详细地址' })
        return
      }
      let bzsqx_sheng = {}
      let templist = this.shenglist
      for (let i = 0; i < templist.length; i++) {
        if (this.lishenData.provinceid === templist[i].provinceid) {
          bzsqx_sheng = templist[i]
        }
      }
      let params = {
        leave_sy_destination: this.lishenData.leave_sy_destination,
        sytid: this.rowDate.sytid,
        id: this.rowDate.id,
        bzsqx_sheng: bzsqx_sheng.province,
        bzsqx_shi: this.lishenData.city,
        seqid: this.rowDate.seqid
      }
      this.$Modal.confirm({
        title: '是否确认进行离沈处置操作？',
        onOk: () => {
          updateLishen(params).then(res => {
            if (res.data.errcode === 0) {
              this.$Notice.success({ title: '成功', desc: res.data.errmsg })
              this.lisheninfo.show = false
              this.rowDate = {}
              this.init()
              this.issubmit = false
            } else {
              this.$Notice.error({ title: '失败', desc: res.data.errmsg })
              this.issubmit = false
            }
          })
        }
      })
    },
    perChange (index) {
      let temparea = this.formData['area' + index]
      if (!temparea) {
        return
      }
      let templist = this.addressInfo['list' + index]
      let tempdata = {}
      for (let i = 0; i < templist.length; i++) {
        if (temparea === templist[i].title) {
          tempdata = templist[i]
        }
      }
      this.getDownAddress(tempdata.id, index + 1)
    },
    perChange1 (index) {
      let temparea = this.hengchuanData['area' + index]
      console.log(this.hengchuanData)
      console.log(temparea)
      if (!temparea) {
        return
      }
      let templist = this.addressInfo['list' + index]
      let tempdata = {}
      for (let i = 0; i < templist.length; i++) {
        if (temparea === templist[i].title) {
          tempdata = templist[i]
        }
      }
      this.getDownAddress(tempdata.id, index + 1)
    },
    getDownAddress (pid, index) {
      let param = {
        pid: pid,
        pageNo: 1,
        pageSize: 200
      }
      grid_downlist(param).then(res => {
        if (res.data.data) {
          this.addressInfo['list' + index] = res.data.data.results
          this.perChange(index)
          console.log(this.rowDate.to_node_code, '=====this.formData.to_node_code===')
          if (this.hengchuaninfo.show) {
            let templist = this.addressInfo['list' + index]
            for (let i = 0; i < templist.length; i++) {
              if (this.rowDate.to_node_code === templist[i].company_code) {
                this.addressInfo['list' + index].splice(i, 1)
              }
            }
          }
        } else {
          this.$Notice.error({ title: '查看失败', desc: '查询地址信息失败' })
        }
      })
    },
    getCompanyList () {
      getUserByMZList({}).then(res => {
        if (res.data.errcode === 0) {
          this.company_list = res.data.data
        } else {
          this.$Notice.error({
            title: '获取社区列表失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    findProvincesList () {
      findProvincesList({}).then(res => {
        if (res.data.errcode === 0) {
          this.shenglist = res.data.data
          console.log(this.shenglist)
          console.log(res.data)
        } else {
          this.$Notice.error({
            title: '获取社区列表失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    shengChange () {
      let params = {
        provinceid: this.lishenData.provinceid
      }
      findCitiesList(params).then(res => {
        if (res.data.errcode === 0) {
          this.shilist = res.data.data
        } else {
          this.$Notice.error({
            title: '获取社区列表失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    findShilianList () {
      let params = {
        eid: this.rowDate.seqid,
        seqid: this.rowDate.seqid
      }
      this.loading2 = true
      findShilianList(params).then(res => {
        if (res.data.errcode === 0) {
          this.data2 = res.data.data
        } else {
          this.$Notice.error({
            title: '获取列表失败',
            desc: res.data.errmsg
          })
        }
        // setTimeout(() => {
        //   console.log(socket, '等待socket链接成功')
        //   this.loading2 = false
        // }, 1500)
        this.loading2 = false
      })
    },
    getCity (code, listname, flag) {
      getCityList({ code: code }).then(res => {
        if (res.data.errcode === 0) {
          this.inoutCity[listname] = res.data.data
          if (flag) {
            if (this.formInfo.province1) {
              this.chaneProv(1)
            }
            if (this.formInfo.province2) {
              this.chaneProv(2)
            }
          }
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
    },
    sizeL (pageSize) {
      this.currentPageSize = pageSize
      this.changePageNo()
    }
  },
  mounted () {
    console.log(this.$store.state.user.severUserInfo.name)
    this.loginuserName = this.$store.state.user.severUserInfo.name
    this.init()
  }
}
</script>
<style>
  .ivu-form .ivu-form-item-label{
    font-size: 14px;
  }
  .ivu-form-item-content{
    font-size: 14px;
  }
  .title-style {
    padding: 8px 12px;
    background-color: #ecf8ff;
    border-radius: 4px;
    border-left: 5px solid #50bfff;
    margin: 15px 0;
    font-size: 16px;
    width: 100%;
  }
  .div-search{
    width: 200px;
  }
  .form-header{
    height: 40px;
  }
  .search-btn{
    margin-left: -55px;
  }
  .page_style {
    margin-top: 10px;
    text-align: right;
  }
  .ios-search{
    text-align: left;
  }
  #hengchuanselect1 .ivu-select-dropdown{
    max-height: 500px;
  }
  #hengchuanselect2 .ivu-select-dropdown{
    max-height: 500px;
  }
  #hengchuanselect3 .ivu-select-dropdown{
    max-height: 400px;
  }
  /* #lishenselect .ivu-select-dropdown{
    max-height: 1000px;
  } */
</style>
